import time
s = open("m2_reverse.txt")
a = [int (x) for x in s]
n = len(a)
t0 = time.time()
for j in range(1, n+1):
    F = 0
    for i in range(1,n-j-1):
        if a[i]>a[i+1]:
            a[i],a[i+1]=a[i+1],a[i]
            F = 1
        if F==0:
            break
t2 = time.time()
print("m2_reverse", round((t2-t0)*1000), "milleseconds")
